<template>
    <el-container class="total">
        <el-container>
            <el-header style="border-top: solid 2px #b2b4b4;margin-right: 20px;">下载中心</el-header>
            <el-main style="border-radius: 10px; border: 1px solid #ccc; padding: 15px;margin-right: 20px;">
                <div>
                    <el-table :data="FireTableData" style="width: 100%">
                        <el-table-column prop="content" label="内容" :width="contentWidth">
                        </el-table-column>
                        <el-table-column prop="time" label="时间" :width="timeWidth">
                        </el-table-column>
                    </el-table>
                </div>
            </el-main>
            <el-footer>
                <el-pagination class="FirePage" @size-change="handleSizeChange" @current-change="handleCurrentChange"
                    :current-page="currentPage" :page-sizes="[10, 20, 30, 40]" :page-size="pageSize"
                    layout="total, sizes, prev, pager, next, jumper" :total="total">
                </el-pagination>
            </el-footer>
        </el-container>
        <el-aside width="300px">
            <div style="color: #0a7ebb; font-size: 20px;">下载类别</div>
            <el-collapse v-model="activeName" accordion>
                <el-collapse-item title="系统软件" name="1">
                </el-collapse-item>
                <el-collapse-item title="杀毒软件" name="2">
                </el-collapse-item>
                <el-collapse-item title="抗震救灾" name="3">
                </el-collapse-item>
                <el-collapse-item title="工作文件" name="4">
                </el-collapse-item>
                <el-collapse-item title="消防广播" name="5">
                </el-collapse-item>
                <el-collapse-item title="工具软件" name="6">
                </el-collapse-item>
                <el-collapse-item title="驱动程序" name="7">
                </el-collapse-item>
                <el-collapse-item title="补丁程序" name="8">
                </el-collapse-item>
                <el-collapse-item title="培训资料" name="9">
                </el-collapse-item>
                <el-collapse-item title="业务资料" name="10">
                </el-collapse-item>
                <el-collapse-item title="业务软件" name="11">
                </el-collapse-item>
                <el-collapse-item title="领导讲话" name="12">
                </el-collapse-item>
            </el-collapse>
        </el-aside>
    </el-container>
</template>
<script>

export default {

    data() {
        return {
            FireTableData: [],
            contentWidth: '600px', // 内容列的宽度
            timeWidth: '300px',     // 时间列的宽度
            currentPage: 1, // 当前页数
            pageSize: 10, // 每页显示条数
            total: 0, // 总条数
        }
    },
    mounted() {
        // 获取数据
        this.getFireData();
    },
    methods: {
        // 获取数据方法
        getFireData() {
            const FireData = [{
                content: 'xxxxxxxxxxxx',
                time: '2024-2-31',
            }, {
                content: 'xxxxxxxxxxxx',
                time: '2024-2-31',
            }, {
                content: 'xxxxxxxxxxxx',
                time: '2024-2-31',
            }, {
                content: 'xxxxxxxxxxxx',
                time: '2024-2-31',
            }, {
                content: 'xxxxxxxxxxxx',
                time: '2024-2-31',
            }, {
                content: 'xxxxxxxxxxxx',
                time: '2024-2-31',
            }, {
                content: 'xxxxxxxxxxxx',
                time: '2024-2-31',
            }, {
                content: 'xxxxxxxxxxxx',
                time: '2024-2-31',
            }, {
                content: 'xxxxxxxxxxxx',
                time: '2024-2-31',
            }, {
                content: 'xxxxxxxxxxxx',
                time: '2024-2-31',
            }, {
                content: 'xxxxxxxxxxxx',
                time: '2024-2-31',
            }];
            this.total = FireData.length; // 总条数
            this.FireTableData = FireData.slice((this.currentPage - 1) * this.pageSize, this.currentPage * this.pageSize); // 分页后的数据
        },
        // 每页显示条数变化时触发
        handleSizeChange(val) {
            this.pageSize = val;
            this.currentPage = 1; // 重置页数
            this.getFireData();
        },
        // 当前页数变化时触发
        handleCurrentChange(val) {
            this.currentPage = val;
            this.getFireData();
        }
    }
};
</script>
<style scoped>
.el-header {
    font-size: 35px;
    line-height: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #0a7ebb;
}

.FirePage {
    margin-top: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}
</style>